//
//  TemplateAbstractCalculator.m
//  LearnObjectiveC
//
//  Created by client on 2017/9/11.
//  Copyright © 2017年 吴可高. All rights reserved.
//

#import "TemplateAbstractCalculator.h"

@implementation TemplateAbstractCalculator

-(int)calculate:(NSString*)exp opt:(NSString*)opt;
{
    NSArray* items = [self split:exp opt:opt];
    return [self calculate:[items[0]intValue] num2:[items[0]intValue]];
}

-(NSArray*)split:(NSString*)expr opt:(NSString*)opt;
{
    NSAssert(opt, @"opt is not nil");
    NSArray * optNums = [expr componentsSeparatedByString:@","];
    int  intNumber_0 = [[optNums firstObject]intValue];
    int  intNumber_1 = [optNums[1]intValue];
    NSArray * intCapacity = @[@(intNumber_0),@(intNumber_1)];
    return intCapacity;
}

-(int)calculate:(int)num1 num2:(int)num2;
{
    return 0;
}

@end
